/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package telas;

import com.mysql.jdbc.Util;
import javax.swing.JOptionPane;
import triagem.TriagemAdmissao;
import triagem.TriagemDAO;
import Util.util;






/**
 *
 * @author Elessandro
 */
public class CadTriagemAdmissao extends javax.swing.JDialog {
    
    

    /**
     * Creates new form triagemAdmissao
     */
    public CadTriagemAdmissao() {
        initComponents();
        setModal(true);
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        edtEstadoCivil = new javax.swing.JComboBox();
        edtCor = new javax.swing.JComboBox();
        edtAlturaPaciente = new javax.swing.JTextField();
        edtIdadePaciente = new javax.swing.JTextField();
        edtPesoPaciente = new javax.swing.JTextField();
        edtNomePaciente = new javax.swing.JTextField();
        edtDataNascPaciente = new javax.swing.JFormattedTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        edtRgPaciente = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        edtEmissaoRg = new javax.swing.JFormattedTextField();
        edtNomePai = new javax.swing.JTextField();
        edtNomeMae = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        edtReligiao = new javax.swing.JComboBox();
        edtCpfPaciente = new javax.swing.JFormattedTextField();
        jLabel35 = new javax.swing.JLabel();
        edtNCartaoSUS = new javax.swing.JTextField();
        jLabel36 = new javax.swing.JLabel();
        edtEscolaridade = new javax.swing.JComboBox();
        jLabel39 = new javax.swing.JLabel();
        edtSexoPaciente = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        endereço = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        edtEnderecoPaciente = new javax.swing.JTextField();
        edtNumCasa = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        edtBairro = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        edtMunicipio = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        edtPontoDeReferencia = new javax.swing.JTextField();
        edtEstado = new javax.swing.JComboBox();
        jLabel22 = new javax.swing.JLabel();
        edtCep = new javax.swing.JFormattedTextField();
        jLabel23 = new javax.swing.JLabel();
        edtTelefone1 = new javax.swing.JFormattedTextField();
        jLabel16 = new javax.swing.JLabel();
        edtCelular = new javax.swing.JFormattedTextField();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        edtProfissao = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        edtOcupacao = new javax.swing.JTextField();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel29 = new javax.swing.JLabel();
        edtNomeResponsavel = new javax.swing.JTextField();
        jLabel30 = new javax.swing.JLabel();
        edtEnderecoResponsavel = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        edtNumCasaResponsavel = new javax.swing.JTextField();
        jLabel32 = new javax.swing.JLabel();
        edtTelefoneResponsavel = new javax.swing.JFormattedTextField();
        jLabel33 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        edtPrincipalSolicitante = new javax.swing.JComboBox();
        jLabel34 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jTabbedPane1.setBackground(new java.awt.Color(255, 255, 255));
        jTabbedPane1.setFont(new java.awt.Font("Verdana", 1, 14)); // NOI18N

        jPanel3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel12.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel12.setText("Nome do Pai:");
        jPanel3.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 230, -1, -1));

        jLabel13.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel13.setText("Nome da Mãe:");
        jPanel3.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 270, -1, -1));

        jLabel8.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel8.setText("Altura:");
        jPanel3.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 110, -1, -1));

        jLabel7.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel7.setText("Peso:");
        jPanel3.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 110, -1, -1));

        jLabel5.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel5.setText("Data Nasc:");
        jPanel3.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 110, -1, -1));

        jLabel6.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel6.setText("Idade:");
        jPanel3.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 110, -1, -1));

        jLabel4.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel4.setText("Nome:");
        jPanel3.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 70, -1, -1));

        edtEstadoCivil.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtEstadoCivil.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--", "Casado", "Solteiro", "Divorciado", "Viuvo", "Outro" }));
        jPanel3.add(edtEstadoCivil, new org.netbeans.lib.awtextra.AbsoluteConstraints(720, 110, 110, -1));

        edtCor.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtCor.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cor", "1 Branco", "2 Pardo", "3 Negro" }));
        jPanel3.add(edtCor, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 150, 90, -1));

        edtAlturaPaciente.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel3.add(edtAlturaPaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 110, 80, -1));

        edtIdadePaciente.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel3.add(edtIdadePaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 110, 60, -1));

        edtPesoPaciente.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel3.add(edtPesoPaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 110, 60, -1));

        edtNomePaciente.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel3.add(edtNomePaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 70, 700, -1));

        try {
            edtDataNascPaciente.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        edtDataNascPaciente.setToolTipText("");
        edtDataNascPaciente.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtDataNascPaciente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                edtDataNascPacienteActionPerformed(evt);
            }
        });
        edtDataNascPaciente.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                edtDataNascPacienteFocusLost(evt);
            }
        });
        jPanel3.add(edtDataNascPaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 110, 120, -1));

        jLabel9.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel9.setText("CPF:");
        jLabel9.setToolTipText("");
        jPanel3.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 150, -1, -1));

        jLabel10.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel10.setText("RG:");
        jPanel3.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 150, -1, -1));

        edtRgPaciente.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel3.add(edtRgPaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 150, 180, -1));

        jLabel11.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel11.setText("Emissão:");
        jPanel3.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 150, -1, -1));

        try {
            edtEmissaoRg.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        edtEmissaoRg.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel3.add(edtEmissaoRg, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 150, 100, -1));

        edtNomePai.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel3.add(edtNomePai, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 230, 680, -1));

        edtNomeMae.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel3.add(edtNomeMae, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 270, 680, -1));

        jLabel27.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel27.setText("Religião:");
        jPanel3.add(jLabel27, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 190, -1, -1));

        jLabel28.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel28.setText("Escolaridade:");
        jPanel3.add(jLabel28, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 190, -1, -1));

        edtReligiao.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtReligiao.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--", "Católico", "Evangelico", "Outro" }));
        edtReligiao.setToolTipText("");
        jPanel3.add(edtReligiao, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 190, -1, -1));

        try {
            edtCpfPaciente.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        edtCpfPaciente.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtCpfPaciente.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                edtCpfPacienteFocusLost(evt);
            }
        });
        jPanel3.add(edtCpfPaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 150, 140, -1));

        jLabel35.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel35.setText("CNS:");
        jPanel3.add(jLabel35, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 190, -1, -1));

        edtNCartaoSUS.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtNCartaoSUS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                edtNCartaoSUSActionPerformed(evt);
            }
        });
        jPanel3.add(edtNCartaoSUS, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 190, 140, -1));

        jLabel36.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel36.setText("Estado Civil:");
        jPanel3.add(jLabel36, new org.netbeans.lib.awtextra.AbsoluteConstraints(630, 110, -1, -1));

        edtEscolaridade.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtEscolaridade.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "- -", "Fundamental", "Ensino Médio", "Superior", "Outros" }));
        jPanel3.add(edtEscolaridade, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 190, 90, 25));

        jLabel39.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel39.setText("Sexo:");
        jPanel3.add(jLabel39, new org.netbeans.lib.awtextra.AbsoluteConstraints(670, 190, -1, -1));

        edtSexoPaciente.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtSexoPaciente.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--", "Masculino", "Feminino" }));
        jPanel3.add(edtSexoPaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(720, 190, 110, -1));

        jLabel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Dados do Paciente", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 14))); // NOI18N
        jPanel3.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 40, 830, 300));

        jTabbedPane1.addTab("IDENTIFICAÇÃO", jPanel3);

        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        endereço.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Endereço do Paciente", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 14))); // NOI18N
        jPanel2.add(endereço, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 811, 30));

        jLabel17.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel17.setText("Endereço:");
        jPanel2.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 50, -1, -1));

        edtEnderecoPaciente.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtEnderecoPaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 50, 490, -1));

        edtNumCasa.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtNumCasa, new org.netbeans.lib.awtextra.AbsoluteConstraints(680, 50, 80, -1));

        jLabel19.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel19.setText("Bairro:");
        jPanel2.add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 90, -1, -1));

        edtBairro.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtBairro, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 90, 490, -1));

        jLabel20.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel20.setText("Município:");
        jPanel2.add(jLabel20, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 170, -1, -1));

        edtMunicipio.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtMunicipio, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 170, 270, -1));

        jLabel21.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel21.setText("Ponto de Referência:");
        jPanel2.add(jLabel21, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 130, -1, -1));

        edtPontoDeReferencia.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtPontoDeReferencia, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 130, 420, -1));

        edtEstado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "UF", "CE", "PB", "RN", " " }));
        jPanel2.add(edtEstado, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 170, 50, -1));

        jLabel22.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel22.setText("CEP:");
        jPanel2.add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 170, -1, -1));

        try {
            edtCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-###")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        edtCep.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtCep, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 170, 150, -1));

        jLabel23.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel23.setText("Telefone Fixo:");
        jPanel2.add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 220, -1, -1));

        try {
            edtTelefone1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        edtTelefone1.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtTelefone1, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 220, 160, -1));

        jLabel16.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel16.setText("Celular.:");
        jPanel2.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 220, -1, -1));

        try {
            edtCelular.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        edtCelular.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtCelular, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 220, 160, -1));

        jLabel24.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel24.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Situação Socio Econômica", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 14))); // NOI18N
        jPanel2.add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 290, 800, 30));

        jLabel25.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel25.setText("Profissão:");
        jPanel2.add(jLabel25, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 330, -1, -1));

        edtProfissao.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtProfissao, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 330, 280, -1));

        jLabel26.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel26.setText("Ocupação Atual:");
        jPanel2.add(jLabel26, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 380, -1, -1));

        edtOcupacao.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel2.add(edtOcupacao, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 380, 240, -1));

        jLabel37.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel37.setText("Nº:");
        jPanel2.add(jLabel37, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 50, -1, -1));

        jLabel38.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel38.setText("Estado:");
        jPanel2.add(jLabel38, new org.netbeans.lib.awtextra.AbsoluteConstraints(630, 170, -1, -1));

        jTabbedPane1.addTab("ENDEREÇO", jPanel2);

        jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel29.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel29.setText("Nome:");
        jPanel4.add(jLabel29, new org.netbeans.lib.awtextra.AbsoluteConstraints(39, 54, -1, -1));

        edtNomeResponsavel.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel4.add(edtNomeResponsavel, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 50, 550, -1));

        jLabel30.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel30.setText("Endereço:");
        jPanel4.add(jLabel30, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 90, -1, -1));

        edtEnderecoResponsavel.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtEnderecoResponsavel.setToolTipText("");
        jPanel4.add(edtEnderecoResponsavel, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 90, 320, -1));

        jLabel31.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel31.setText("Nº");
        jPanel4.add(jLabel31, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 90, -1, -1));

        edtNumCasaResponsavel.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel4.add(edtNumCasaResponsavel, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 90, 70, -1));

        jLabel32.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel32.setText("Telefone:");
        jPanel4.add(jLabel32, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 130, -1, -1));

        try {
            edtTelefoneResponsavel.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        edtTelefoneResponsavel.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel4.add(edtTelefoneResponsavel, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 130, 180, -1));

        jLabel33.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Dados do Responsável", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 14))); // NOI18N
        jPanel4.add(jLabel33, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, 810, 160));

        jPanel5.setBackground(java.awt.SystemColor.activeCaption);
        jPanel5.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jButton1.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/salvar.png"))); // NOI18N
        jButton1.setText("Salvar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel5.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 10, -1, -1));

        jButton2.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/cancelar.png"))); // NOI18N
        jButton2.setText("Cancelar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jPanel5.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 10, -1, -1));

        jPanel4.add(jPanel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 400, 880, 50));

        edtPrincipalSolicitante.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        edtPrincipalSolicitante.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--", "Pròprio", "Serviço de Pronto Atendimento -SPA", "ACS/PSF", "Colega de Trabalho", "Hospital", "Polícia", "Familiar", "Vizinho", "Outros" }));
        jPanel4.add(edtPrincipalSolicitante, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 220, 190, -1));

        jLabel34.setFont(new java.awt.Font("Verdana", 1, 14)); // NOI18N
        jLabel34.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Principal Solicitante do Contrato:", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 14))); // NOI18N
        jPanel4.add(jLabel34, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 200, 810, 60));

        jLabel40.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel40.setText("Bairro:");
        jPanel4.add(jLabel40, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 130, -1, -1));

        jTextField1.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jPanel4.add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 130, 320, -1));

        jTabbedPane1.addTab("RESPONSÁVEL", jPanel4);

        jPanel1.add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 130, 880, 490));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/fundo2.jpg"))); // NOI18N
        jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        jLabel18.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N
        jLabel18.setText("Nº");
        jPanel1.add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 50, -1, -1));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
       
     TriagemAdmissao paciente = new TriagemAdmissao();
     
     //ABA IDENTIFICAÇAO
     paciente.setNomePaciente(edtNomePaciente.getText());
     paciente.setDataNascPaciente(edtDataNascPaciente.getText());
     paciente.setIdadePaciente(Integer.parseInt(edtIdadePaciente.getText()));
     paciente.setPesoPaciente((float)Double.parseDouble(edtPesoPaciente.getText()));
     paciente.setAlturaPaciente((float) Double.parseDouble(edtAlturaPaciente.getText()));
     paciente.setEstadocivilPaciente(edtEstadoCivil.getSelectedItem().toString());
     paciente.setCPFPaciente(jLabel3.getText());
        


     paciente.setRGPaciente(edtRgPaciente.getText());
     paciente.setDataEmissao(edtEmissaoRg.getText());
     paciente.setCorPaciente(edtCor.getSelectedItem().toString());
     paciente.setCNSPaciente(edtNCartaoSUS.getText());
     paciente.setRegiliaoPaciente(edtReligiao.getSelectedItem().toString());
     paciente.setEscoalridadepaciente(edtEscolaridade.getSelectedItem().toString());
     paciente.setSexoPaciente(edtSexoPaciente.getSelectedItem().toString());
     paciente.setNomePai(edtNomePai.getText());
     paciente.setNomeMae(edtNomeMae.getText());
     
     //ABA ENDEREÇO
     paciente.setEnderecopaciente(edtEnderecoPaciente.getText());
     paciente.setNumpaciente(Integer.parseInt(edtNumCasa.getText()));
     paciente.setBairropaciente(edtBairro.getText());
     paciente.setPontoreferencia(edtPontoDeReferencia.getText());
     paciente.setMunicipiopaciente(edtMunicipio.getText());
     paciente.setCEP(edtCep.getText());
     paciente.setTelefonepaciente(edtTelefone1.getText());
     paciente.setCelularpaciente(edtCelular.getText());
     paciente.setProfissaopaciente(edtProfissao.getText());
     paciente.setOcupacaopaciente(edtOcupacao.getText());
     paciente.setEstado(edtEstado.getSelectedItem().toString());
     
     //ABA RESPONSAVEL
     paciente.setNomeresponsavel(edtNomeResponsavel.getText());
     paciente.setEnderecoresponsavel(edtEnderecoResponsavel.getText());
     paciente.setNumresponsavel(Integer.parseInt(edtNumCasaResponsavel.getText()));
     paciente.setBairroresponsavel(jTextField1.getText());
     paciente.setTelefoneresponsavel(edtTelefoneResponsavel.getText());
     paciente.setSolicitante(edtPrincipalSolicitante.getSelectedItem().toString());
     
     
     
     
     TriagemDAO tri = new TriagemDAO();
      tri.salvar(paciente);
      JOptionPane.showMessageDialog(edtNomePaciente, 
                "Novo Paciente: "+paciente.getNomePaciente()+
                ", Cadastrado com Sucesso!");
      
       
    }//GEN-LAST:event_jButton1ActionPerformed

    private void edtNCartaoSUSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_edtNCartaoSUSActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_edtNCartaoSUSActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void edtDataNascPacienteFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_edtDataNascPacienteFocusLost
        // TODO add your handling code here:
        if (!util.dataValida(edtDataNascPaciente.getText().toString())) {
            JOptionPane.showMessageDialog(rootPane, "Data inválida!", "ERRO", JOptionPane.ERROR_MESSAGE);
            edtDataNascPaciente.setText("");
            
            if (!edtDataNascPaciente.isFocusOwner()) {
                
                edtDataNascPaciente.requestFocus();
            }
        }
    }//GEN-LAST:event_edtDataNascPacienteFocusLost

    private void edtDataNascPacienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_edtDataNascPacienteActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_edtDataNascPacienteActionPerformed

    private void edtCpfPacienteFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_edtCpfPacienteFocusLost
        // TODO add your handling code here:
           if (!util.CPF(edtCpfPaciente.getText().toString().replaceAll("\\D*", ""))) {
            JOptionPane.showMessageDialog(rootPane, "Este CPF não é válido, Redigite!", "ERRO", JOptionPane.ERROR_MESSAGE);
            edtCpfPaciente.setText("");

            if (!edtCpfPaciente.isFocusOwner()) {

                edtCpfPaciente.requestFocus();
            }
        }
    }//GEN-LAST:event_edtCpfPacienteFocusLost

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(CadTriagemAdmissao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(CadTriagemAdmissao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(CadTriagemAdmissao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(CadTriagemAdmissao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new CadTriagemAdmissao().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JTextField edtAlturaPaciente;
    private javax.swing.JTextField edtBairro;
    private javax.swing.JFormattedTextField edtCelular;
    private javax.swing.JFormattedTextField edtCep;
    private javax.swing.JComboBox edtCor;
    private javax.swing.JFormattedTextField edtCpfPaciente;
    private javax.swing.JFormattedTextField edtDataNascPaciente;
    private javax.swing.JFormattedTextField edtEmissaoRg;
    private javax.swing.JTextField edtEnderecoPaciente;
    private javax.swing.JTextField edtEnderecoResponsavel;
    private javax.swing.JComboBox edtEscolaridade;
    private javax.swing.JComboBox edtEstado;
    private javax.swing.JComboBox edtEstadoCivil;
    private javax.swing.JTextField edtIdadePaciente;
    private javax.swing.JTextField edtMunicipio;
    private javax.swing.JTextField edtNCartaoSUS;
    private javax.swing.JTextField edtNomeMae;
    private javax.swing.JTextField edtNomePaciente;
    private javax.swing.JTextField edtNomePai;
    private javax.swing.JTextField edtNomeResponsavel;
    private javax.swing.JTextField edtNumCasa;
    private javax.swing.JTextField edtNumCasaResponsavel;
    private javax.swing.JTextField edtOcupacao;
    private javax.swing.JTextField edtPesoPaciente;
    private javax.swing.JTextField edtPontoDeReferencia;
    private javax.swing.JComboBox edtPrincipalSolicitante;
    private javax.swing.JTextField edtProfissao;
    private javax.swing.JComboBox edtReligiao;
    private javax.swing.JTextField edtRgPaciente;
    private javax.swing.JComboBox edtSexoPaciente;
    private javax.swing.JFormattedTextField edtTelefone1;
    private javax.swing.JFormattedTextField edtTelefoneResponsavel;
    private javax.swing.JLabel endereço;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField jTextField1;
    // End of variables declaration//GEN-END:variables
}
